<!DOCTYPE html>
<html>
<body>
<p>Testing cloneNode(true) on textarea element works correctly</p>
<p>Before clone</p>
<textarea name="" id="textarea1" cols="15" rows="2">InitialText</textarea>
<textarea name="" id="textarea2" cols="15" rows="2">InitialText</textarea>
<textarea name="" id="textarea3" cols="15" rows="2">InitialText</textarea>
<p>After clone</p>
<script>
// cloning text
var textarea1 = document.getElementById('textarea1');
document.body.appendChild(textarea1.cloneNode(true));

// User input
var textarea2 = document.getElementById('textarea2');
textarea2.focus();
document.execCommand('InsertText', false, 'InsertedText ');
document.body.appendChild(textarea2.cloneNode(true));
textarea2.blur();

// Updating IDL value
var textarea3 = document.getElementById('textarea3');
textarea3.value = "NewText";
document.body.appendChild(textarea3.cloneNode(true));
</script>
</body>
</html>
